package com.itheima;

import java.util.Scanner;

public class test01 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入手机号码");
        String s = sc.next();
        tel(s);
    }

    public static void tel(String s) {
        if (s.length() != 11) {
            System.out.println("注册用户失败");
            return;
        }
        for (int i = 0; i < s.length(); i++) {
            char c = s.charAt(i);
            if (c < '0' || c > '9') {
                System.out.println("注册用户失败");
                return;
            }
        }
        System.out.println("手机号后四位:"+s.substring(s.length() - 4));
    }
}
